<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Create Travel Package</title>
	<link rel="stylesheet" href="register.css" type="text/css" media="all"/>
</h:head>

<h:body style="background-image: url(images/templatemo_body.jpg) " >
	<p style="font-size: xx-large; font-family: Arial, Helvetica, sans-serif; color: #CC0000">CREATE PREDEFINED TRAVELPACKAGE</p>
	<p:button outcome="employeeHome" value="BACK" icon="ui-icon-arrowreturnthick-1-w"/>
			
	<br />
	

	<h:form id="form"> 
		<p:growl id="msgs" showDetail="true" />  
		<h:panelGrid columns="4" id="firstGrid"> 
			
			 <h:outputLabel for="displayToGo">ToGo Transportation:</h:outputLabel>
			    <p:inputText id="displayToGo" value="#{packageBean.predTP.meanOfTransportation1.toString()}"  style="width: 500px;" editable="false"/>  
			     

 				<p:commandButton id="ToGoTables" value="Select" type="button" /> 
         
         
       
                   <p:overlayPanel id="ToGoPanel" for="ToGoTables" hideEffect="fade" dynamic="true"> 
 						 <h:form>
  				
   				 		<p:dataTable id="ToGos" var="toGo" value="#{transportationBean.getMeanModel()}">  
  
							        <p:column headerText="TransportationID" style="width:24%">  
							            <h:outputText value="#{toGo.transportationID}" />  
							        </p:column>  
							  
							        <p:column headerText="Trip" style="width:24%">  
							            <h:outputText value="#{toGo.trip.toString()}" />  
							        </p:column> 
							        
							        <p:column headerText="Type" style="width:24%">  
							            <h:outputText value="#{toGo.transportationType.toString()}" />  
							        </p:column> 
							        
							        <p:column headerText="Cost">  
							            <h:outputText value="#{toGo.cost}" />  
							        </p:column> 
							        
							        <p:column headerText="Departure Time">  
							            <h:outputText value="#{toGo.departureTime}" />  
							        </p:column>
							        
							        <p:column headerText="Duration">  
							            <h:outputText value="#{toGo.duration}" />  
							        </p:column>
 
							  
							        <p:column style="width:4%">  
							                <p:commandButton id="selectButton" action="#{packageBean.setTPGo(toGo)}"   icon="ui-icon-check" title="View" process="@this" update=":form:displayToGo :form:secondGrid">  
							            </p:commandButton>  
							        </p:column> 
							
						</p:dataTable>
				   </h:form>
				    </p:overlayPanel>  
				    
				<h:outputLabel for="displayReturn">Return Transportation:</h:outputLabel>
			    <p:inputText id="displayReturn" value="#{packageBean.predTP.meanOfTransportation2.toString()}"  style="width: 500px;" editable="false"/>  
			     

 				<p:commandButton id="ReturnTables" value="Select" type="button" /> 
         
         
       
                   <p:overlayPanel id="ReturnPanel" for="ReturnTables" hideEffect="fade" dynamic="true"> 
 						 <h:form>
  				
   				 		<p:dataTable id="Returns" var="return" value="#{packageBean.getReturns()}">  
  
							        <p:column headerText="TransportationID" style="width:24%">  
							            <h:outputText value="#{return.transportationID}" />  
							        </p:column>  
							  
							        <p:column headerText="Trip" style="width:24%">  
							            <h:outputText value="#{return.trip.toString()}" />  
							        </p:column> 
							        
							        <p:column headerText="Type" style="width:24%">  
							            <h:outputText value="#{return.transportationType.toString()}" />  
							        </p:column> 
							        
							        <p:column headerText="Cost">  
							            <h:outputText value="#{return.cost}" />  
							        </p:column> 
							        
							        <p:column headerText="Departure Time">  
							            <h:outputText value="#{return.departureTime}" />  
							        </p:column>
							        
							        <p:column headerText="Duration">  
							            <h:outputText value="#{return.duration}" />  
							        </p:column>
 
							  
							        <p:column style="width:4%">  
							                <p:commandButton id="selectButton" action="#{packageBean.setTPReturn(return)}"   icon="ui-icon-check" title="View" process="@this" update=":form:displayReturn">  
							            </p:commandButton>  
							        </p:column>
							
						</p:dataTable>
				   </h:form>
				    </p:overlayPanel> 
				    
				<h:outputText value="Hotel:" />
				<p:inputText id="displayHotel" value="#{packageBean.predTP.hotelBean.getName()}"  style="width: 500px;" editable="false"/>  
					     
		 		<p:commandButton id="HotelsTables" value="Select" type="button" /> 
		         
		          <p:overlayPanel id="Hotels" for="HotelsTables" hideEffect="fade" dynamic="true"> 
		 				<h:form>
		  				<p:dataTable id="hotelList" var="hotel" value="#{packageBean.getHotels()}" >
		   				 
		   				 	<p:column headerText="HotelID" style="width:30%">  
		                    	<h:outputText value="#{hotel.hotelID}" />  
		                    </p:column>  
					  
					        <p:column headerText="Name" style="width:20%">  
					            <h:outputText value="#{hotel.name}" />  
					        </p:column>  
					        
					        <p:column headerText="Street Name" style="width:20%">  
					                    <h:outputText value="#{hotel.streetName}" />   
			        		</p:column>
			        		
			        		<p:column headerText="Street Number" style="width:20%">  
					                    <h:outputText value="#{hotel.streetNumber}" />   
			        		</p:column>
			        		
			        		<p:column headerText="Place of Location" style="width:20%">  
					                    <h:outputText value="#{hotel.arrivalPlace}" />   
			        		</p:column>
			        		
			        		<p:column headerText="Classification" style="width:20%">  
					                    <h:outputText value="#{hotel.classification}" />   
			        		</p:column>  
			        		
			        		<p:column headerText="Cost" style="width:20%">  
					                    <h:outputText value="#{hotel.cost}" />   
			        		</p:column>
					  
					        <p:column style="width:4%">  
					                 <p:commandButton action="#{packageBean.setTPHotel(hotel)}" icon="ui-icon-check" update=":form:displayHotel"  process="@this"  >  
								
					            </p:commandButton>  
					        </p:column>  
		
		    			</p:dataTable>
		   				</h:form>
		    	</p:overlayPanel>  
		</h:panelGrid> 
		<h:panelGrid columns="2" id="secondGrid"> 
			 <p:dataTable id="excList" var="exc" value="#{packageBean.getExcList()}" > 
					  		<f:facet name="header">  
					            Added Excursions
					        </f:facet>
					  		<p:column headerText="ExcursionID" style="width:20%">  
					                    <h:outputText value="#{exc.excursionID}" />   
			        		</p:column>
			        			
					        <p:column headerText="Name" style="width:20%">  
					            <h:outputText value="#{exc.name}" />  
					        </p:column>  
					        
					        <p:column headerText="Place of Location" style="width:20%">  
					                    <h:outputText value="#{exc.arrivalPlace}" />   
			        		</p:column>
					  
					        <p:column style="width:4%">  
					                 <p:commandButton action="#{packageBean.removeTPExcursion(exc)}" icon="ui-icon-minus" update=":form:secondGrid"  process="@this"  >  
								
					            </p:commandButton>  
					        </p:column>  
		
		    			</p:dataTable>
		    			
		  				<p:dataTable id="excursions" var="excursion" value="#{packageBean.getExcursions()}" >
		   				 	<f:facet name="header">  
					            Available Excursions 
					        </f:facet>
		   				 	<p:column headerText="ID" style="width:30%">  
		                    	<h:outputText value="#{excursion.excursionID}" />  
		                    </p:column>  
					  
					        <p:column headerText="Name" style="width:20%">  
					            <h:outputText value="#{excursion.name}" />  
					        </p:column>  
					        
					        <p:column headerText="Place of Location" style="width:20%">  
					                    <h:outputText value="#{excursion.arrivalPlace}" />   
			        		</p:column>
			        		
			        		<p:column headerText="Meeting Place" style="width:20%">  
					                    <h:outputText value="#{excursion.meetingPlace}" />   
			        		</p:column>
			        		
			        		<p:column headerText="Meeting Time" style="width:20%">  
					                    <h:outputText value="#{excursion.meetingTime}" />   
			        		</p:column>
			        		
			        		<p:column headerText="Cost" style="width:20%">  
					                    <h:outputText value="#{excursion.cost}" />   
			        		</p:column>
					  
					        <p:column style="width:4%">  
					                 <p:commandButton action="#{packageBean.addTPExcursion(excursion)}" icon="ui-icon-plus" update=":form:secondGrid"  process="@this"  >  
								
					            </p:commandButton>  
					        </p:column>  
		
		    			</p:dataTable>
		   			
		    	
		</h:panelGrid>
			<p:commandButton action="#{packageBean.createPredTP(userBean.user)}" icon="ui-icon-disk" value="save" update=":form:msgs" process="@this"  >  
								
					            </p:commandButton>
	</h:form>
</h:body>
</html>